package com.howcan.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
import com.howcan.v1.R;

public abstract class BasicAdapter extends BaseAdapter
{
  public static final Object ERROR;
  public static final Object HEAD;
  public static final Object LOADING = new Object();

  static
  {
    ERROR = new Object();
    HEAD = new Object();
  }

  protected View getFailedView(String paramString, View.OnClickListener paramOnClickListener, ViewGroup paramViewGroup, View paramView)
  {
    View localView1 = paramView;
      if (localView1 == null) {
        localView1 = LayoutInflater.from(paramViewGroup.getContext()).inflate(R.layout.error_item, paramViewGroup, false);
        localView1.setTag(ERROR);
    }
    ((TextView)localView1.findViewById(16908308)).setText(paramString);
    Button btn_retry = (Button) localView1.findViewById(R.id.btn_retry);
    if (paramOnClickListener != null) {
          btn_retry.setVisibility(0);
          btn_retry.setOnClickListener(paramOnClickListener);
          btn_retry.requestFocus();
      } else btn_retry.setVisibility(8);
    return localView1;
  }

  protected View getLoadingView(ViewGroup paramViewGroup, View paramView)
  {
    View localView = null;
    if (paramView == null){
        localView = LayoutInflater.from(paramViewGroup.getContext()).inflate(2130903124, paramViewGroup, false);
        localView.setTag(LOADING);
      }
     return localView;
  }
}
